import type { PatientItem, PatientParams } from "@/types/patien"
import request from "@/utils/request"

/**
 * 获取患者（家庭档案）列表
 */
export const getPatientListApi = () => {
  return request.get<null, PatientItem[]>('/patient/mylist')
}
/**
 * 添加患者（家庭档案）
 */
export const getAddPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}

/**
 * 删除患者（家庭档案）
 */
export const deletePatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`,)
}

/**
 * 患者详情（家庭档案）
 */
export const patientDetailApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}

/**
 * 更新患者信息（家庭档案）
 */
export const updatePatientApi = (data: PatientParams) => {
  return request.put<null, PatientItem>(`/patient/update/`, data)
}

